package gui;

import javax.swing.SwingUtilities;
import javax.swing.JFrame;

public class SwingConsole {
    public static void run(final JFrame f, final int width, final int height,
            final String title) {   
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                if (title.equals(""))
                    f.setTitle(f.getClass().getSimpleName());
                else
                    f.setTitle(title);
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.setSize(width, height);
                f.setVisible(true);
            }
        });
    }
}